package MemTrac::Tables;
use strict;
use Carp;

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw( get_structure get_tables );
our @EXPORT_OK = qw();

my %tables = (
    members => {
        characterID => "INTEGER PRIMARY KEY NOT NULL",
        name => "TEXT",
        title => "TEXT",
        roles => "DOUBLE",
        grantableRoles => "DOUBLE",
        location => "TEXT",
        locationID => "INTEGER",
        shipType => "TEXT",
        shipTypeID => "INTEGER",
        base => "TEXT",
        baseID => "INTEGER",
        startDateTime => "INTEGER",
        logonDateTime => "INTEGER",
        logoffDateTime => "INTEGER",
    },
    alts => {
        altID => "INTEGER PRIMARY KEY NOT NULL",
        alt_of => "INTEGER",
    },
    types => {
        typeID => "INTEGER PRIMARY KEY NOT NULL",
        type => "INTEGER",
    },
    expiries_generic => {
        type => "CHAR(30) PRIMARY KEY NOT NULL",
        expiry => "INTEGER",
    },
);

sub get_structure {
    my ($table) = @_;
    
    return $tables{$table};
}

sub get_tables {
    my ($table) = @_;
    
    return keys %tables;
}

1;

__END__




    <members>
        <field>characterID</field>
        <field>name</field>
        <field>title</field>
        <field>roles</field>
        <field>grantableRoles</field>
        <field>location</field>
        <field>locationID</field>
        <field>shipType</field>
        <field>shipTypeID</field>
        <field>base</field>
        <field>baseID</field>
        <field>startDateTime</field>
        <field>logonDateTime</field>
        <field>logoffDateTime</field>
    </members>
    <alts>
        <field>characterID</field>
        <field>alt_of</field>
    </alts>


1;
